home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / -archivi / -recent2 / ggdebug.lha / ppcpragmas / ggdebug_pragmas.h
C/C++ Source or Header  |  1999-03-11  |  5KB  |  189 lines

  1. /* Automatically generated header! Do not edit! */
  2.  
  3. #ifndef _PPCPRAGMA_GGDEBUG_H
  4. #define _PPCPRAGMA_GGDEBUG_H
  5. #ifdef __GNUC__
  6. #ifndef _PPCINLINE__GGDEBUG_H
  7. #include <powerup/ppcinline/ggdebug.h>
  8. #endif
  9. #else
  10.  
  11. #include <stdarg.h>
  12. #include <stdio.h>
  13.  
  14. #ifndef POWERUP_PPCLIB_INTERFACE_H
  15. #include <powerup/ppclib/interface.h>
  16. #endif
  17.  
  18. #ifndef POWERUP_GCCLIB_PROTOS_H
  19. #include <powerup/gcclib/powerup_protos.h>
  20. #endif
  21.  
  22. #ifndef NO_PPCINLINE_STDARG
  23. #define NO_PPCINLINE_STDARG
  24. #endif/* SAS C PPC inlines */
  25.  
  26. #ifndef GGDEBUG_BASE_NAME
  27. #define GGDEBUG_BASE_NAME GGDebugBase
  28. #endif /* !GGDEBUG_BASE_NAME */
  29.  
  30. #define    KCmpStr(string1, string2)    _KCmpStr(GGDEBUG_BASE_NAME, string1, string2)
  31.  
  32. static __inline LONG
  33. _KCmpStr(void *GGDebugBase, STRPTR string1, STRPTR string2)
  34. {
  35. struct Caos    MyCaos;
  36.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  37. //    MyCaos.M68kStart    =    NULL;
  38. //    MyCaos.M68kSize        =    0;
  39.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  40. //    MyCaos.PPCStart        =    NULL;
  41. //    MyCaos.PPCSize        =    0;
  42.     MyCaos.a0        =(ULONG) string1;
  43.     MyCaos.a1        =(ULONG) string2;
  44.     MyCaos.caos_Un.Offset    =    (-30);
  45.     MyCaos.a6        =(ULONG) GGDebugBase;    
  46.     return((LONG)PPCCallOS(&MyCaos));
  47. }
  48.  
  49. #define    KDoFmt(formatString, datastream, putChProc, putChData)    _KDoFmt(GGDEBUG_BASE_NAME, formatString, datastream, putChProc, putChData)
  50.  
  51. static __inline APTR
  52. _KDoFmt(void *GGDebugBase, STRPTR formatString, STRPTR datastream, void (*putChProc)(), APTR putChData)
  53. {
  54. struct Caos    MyCaos;
  55.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  56. //    MyCaos.M68kStart    =    NULL;
  57. //    MyCaos.M68kSize        =    0;
  58.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  59. //    MyCaos.PPCStart        =    NULL;
  60. //    MyCaos.PPCSize        =    0;
  61.     MyCaos.a0        =(ULONG) formatString;
  62.     MyCaos.a1        =(ULONG) datastream;
  63.     MyCaos.a2        =(ULONG) putChProc;
  64.     MyCaos.a3        =(ULONG) putChData;
  65.     MyCaos.caos_Un.Offset    =    (-36);
  66.     MyCaos.a6        =(ULONG) GGDebugBase;    
  67.     return((APTR)PPCCallOS(&MyCaos));
  68. }
  69.  
  70. #define    KGetChar()    _KGetChar(GGDEBUG_BASE_NAME)
  71.  
  72. static __inline LONG
  73. _KGetChar(void *GGDebugBase)
  74. {
  75. struct Caos    MyCaos;
  76.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  77. //    MyCaos.M68kStart    =    NULL;
  78. //    MyCaos.M68kSize        =    0;
  79.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  80. //    MyCaos.PPCStart        =    NULL;
  81. //    MyCaos.PPCSize        =    0;
  82.     MyCaos.caos_Un.Offset    =    (-42);
  83.     MyCaos.a6        =(ULONG) GGDebugBase;    
  84.     return((LONG)PPCCallOS(&MyCaos));
  85. }
  86.  
  87. #define    KMayGetChar()    _KMayGetChar(GGDEBUG_BASE_NAME)
  88.  
  89. static __inline LONG
  90. _KMayGetChar(void *GGDebugBase)
  91. {
  92. struct Caos    MyCaos;
  93.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  94. //    MyCaos.M68kStart    =    NULL;
  95. //    MyCaos.M68kSize        =    0;
  96.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  97. //    MyCaos.PPCStart        =    NULL;
  98. //    MyCaos.PPCSize        =    0;
  99.     MyCaos.caos_Un.Offset    =    (-48);
  100.     MyCaos.a6        =(ULONG) GGDebugBase;    
  101.     return((LONG)PPCCallOS(&MyCaos));
  102. }
  103.  
  104. #define    KPutChar(character)    _KPutChar(GGDEBUG_BASE_NAME, character)
  105.  
  106. static __inline LONG
  107. _KPutChar(void *GGDebugBase, LONG character)
  108. {
  109. struct Caos    MyCaos;
  110.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  111. //    MyCaos.M68kStart    =    NULL;
  112. //    MyCaos.M68kSize        =    0;
  113.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  114. //    MyCaos.PPCStart        =    NULL;
  115. //    MyCaos.PPCSize        =    0;
  116.     MyCaos.d0        =(ULONG) character;
  117.     MyCaos.caos_Un.Offset    =    (-54);
  118.     MyCaos.a6        =(ULONG) GGDebugBase;    
  119.     return((LONG)PPCCallOS(&MyCaos));
  120. }
  121.  
  122. #define    KPutStr(string)    _KPutStr(GGDEBUG_BASE_NAME, string)
  123.  
  124. static __inline VOID
  125. _KPutStr(void *GGDebugBase, STRPTR string)
  126. {
  127. struct Caos    MyCaos;
  128.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  129. //    MyCaos.M68kStart    =    NULL;
  130. //    MyCaos.M68kSize        =    0;
  131.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  132. //    MyCaos.PPCStart        =    NULL;
  133. //    MyCaos.PPCSize        =    0;
  134.     MyCaos.a0        =(ULONG) string;
  135.     MyCaos.caos_Un.Offset    =    (-60);
  136.     MyCaos.a6        =(ULONG) GGDebugBase;    
  137.     PPCCallOS(&MyCaos);
  138. }
  139.  
  140. #define    VKPrintf(format, data)    _VKPrintf(GGDEBUG_BASE_NAME, format, data)
  141.  
  142. #ifndef NO_PPCINLINE_STDARG
  143. #define KPrintf(a0, tags...) \
  144.     {ULONG _tags[] = { tags }; VKPrintf((a0), (APTR)_tags);}
  145. #endif /* !NO_PPCINLINE_STDARG */
  146.  
  147. static __inline APTR
  148. _VKPrintf(void *GGDebugBase, STRPTR format, APTR data)
  149. {
  150. struct Caos    MyCaos;
  151.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  152. //    MyCaos.M68kStart    =    NULL;
  153. //    MyCaos.M68kSize        =    0;
  154.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  155. //    MyCaos.PPCStart        =    NULL;
  156. //    MyCaos.PPCSize        =    0;
  157.     MyCaos.a0        =(ULONG) format;
  158.     MyCaos.a1        =(ULONG) data;
  159.     MyCaos.caos_Un.Offset    =    (-66);
  160.     MyCaos.a6        =(ULONG) GGDebugBase;    
  161.     return((APTR)PPCCallOS(&MyCaos));
  162. }
  163.  
  164. #define KPrintf _KPrintf
  165.  
  166. static __inline LONG _KPrintf(STRPTR format, ...)
  167. {
  168.     va_list ap;
  169.     struct Caos MyCaos;
  170.     char buffer[256];
  171.  
  172.     va_start(ap,format);
  173.     vsprintf(buffer,format,ap);
  174.     va_end(ap);
  175.     MyCaos.M68kCacheMode    =    IF_CACHEFLUSHALL;
  176. //    MyCaos.M68kStart    =    NULL;
  177. //    MyCaos.M68kSize        =    0;
  178.     MyCaos.PPCCacheMode    =    IF_CACHEFLUSHALL;
  179. //    MyCaos.PPCStart        =    NULL;
  180. //    MyCaos.PPCSize        =    0;
  181.     MyCaos.a0        =(ULONG) buffer;
  182.     MyCaos.caos_Un.Offset    =    (-60);
  183.     MyCaos.a6        =(ULONG) GGDebugBase;    
  184.     return (LONG)PPCCallOS(&MyCaos);
  185. }
  186.  
  187. #endif /* SASC Pragmas */
  188. #endif /* !_PPCPRAGMA_GGDEBUG_H */
  189.